package projectwork;
import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;

//package com.example.tests;
public class Selenium_fst{

/*public  static void main(String args[]){
	
	FirefoxDriver	driver = new FirefoxDriver();
	
	driver.get("http://espn.go.com/nba/schedule");
	List<WebElement> rc0= driver.findElement(By.xpath("//*[@id='my-teams-table']/div[1]/div/table[2]/tbody")).findElements(By.tagName("tr"));
	
	System.out.println("The Match schedule for :"+rc0.get(0).getText());
	
	List<WebElement> rc= driver.findElement(By.xpath("//*[@id='my-teams-table']/div[1]/div/table[2]/tbody")).findElements(By.tagName("td"));
	//System.out.println(rc.get(2).getText());
	
	//rc.size();
	
	
	
	for(int i=0;i<rc.size();i++){
		List<WebElement> rc1= rc.get(i).findElements(By.tagName("tr"));
	
		System.out.print(rc.get(i).getText());
		
		for(int j=0;j<rc1.size();i++)
		{
			
			System.out.print(rc1.get(j).getText());
		
			
		}
	driver.close();
	}
	*/

	
	public static void main(String args[]){

		String URL = "http://datatables.net/release-datatables/extras/TableTools/index.html";
		
		
		
		FirefoxDriver	driver = new FirefoxDriver();
		
		driver.get(URL);	
		List<WebElement> dtr=driver.findElement(By.xpath("//*[@id='example']/thead")).findElements(By.tagName("tr"));
		List<WebElement> dtc=driver.findElement(By.xpath("html/body/div[2]/div[2]/div/table/tbody")).findElements(By.tagName("tr"));
		
		System.out.println("Print the headers"+dtr.get(0).getText());
		System.out.println(dtc.get(0).getText());	
		
		//("//*[@id='example']/tbody")).;
		//("html/body/div[2]/div[2]/div/table/tbody")
		
		driver.close();

}}